<?php
//set_magic_quotes_runtime(0);
$mtime = explode(' ', microtime());
$spots_starttime = $mtime[1] + $mtime[0];
//session设置
/*session_save_path("\\xampp\\tmp_site");//单独定义session保存路径
if(@function_exists("session_cache_limiter")) {
	session_cache_limiter("private, must-revalidate");	////不清空表单，只在session生效期间
}*/

if(!is_array($_SESSION))session_start();

if(PHP_VERSION < '4.1.0') {
    $_GET = &$HTTP_GET_VARS;
    $_POST = &$HTTP_POST_VARS;
    $_COOKIE = &$HTTP_COOKIE_VARS;
    $_SERVER = &$HTTP_SERVER_VARS;
    $_ENV = &$HTTP_ENV_VARS;
    $_FILES = &$HTTP_POST_FILES;
}


//$handler = set_error_handler('cmdErrorHandler'); 
!defined('DS') & define('DS', DIRECTORY_SEPARATOR);
define('IN_SITE', TRUE);
define('SITE_ROOT', substr(dirname(__FILE__), 0, -8));
define('CLASS_ROOT', SITE_ROOT.'/includes/classes');
define('CACHE_PATH', SITE_ROOT.DS.'.'.DS.'_cache'.DS); //缓存默认存储路径
//include(SITE_ROOT.'/config.inc.php');
include(SITE_ROOT.'/includes/global.func.inc.php');
include(SITE_ROOT.'/includes/db_'.$database.'.class.php');	
include(SITE_ROOT.'/includes/db_tables.inc.php');
include(SITE_ROOT.'/includes/defined.inc.php');

//@set_magic_quotes_runtime(1);
//ini_set('magic_quotes_gpc',1);
$magic_quotes_gpc = get_magic_quotes_gpc();
@extract(daddslashes($_COOKIE));  //extract函数用来将变量从数组中导入到当前的符号表中
@extract(daddslashes($_POST));
@extract(daddslashes($_GET));
//error_reporting($error_level);
$gzipcompress =0;
$action = $act=$id= '';

$timestamp   = time();
$datestamp   = date('Y-m-d H:i:s',$timestamp);
$datestamp2 = date('n/j/Y H:i A',$timestamp);
$time_start   = getmicrotime();
$onlineip       = get_onlineip();
$PHP_SELF = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
$SCRIPT_FILENAME = str_replace('\\\\', '/', (isset($_SERVER['PATH_TRANSLATED']) ? $_SERVER['PATH_TRANSLATED'] : $_SERVER['SCRIPT_FILENAME']));



//连接数据库
$db = new dbstuff;
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset);
//$dbuser = $dbpw = $pconnect = $sdb = NULL;

?>